﻿<Page x:Class="PerspectiveDemo.Wpf.View.RangeControlDemo"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:p="http://www.codeplex.com/perspective"
      mc:Ignorable="d" 
      FontSize="14" Style="{StaticResource PageStyle}"
      d:DesignHeight="300" d:DesignWidth="300"
	Title="RangeControlDemo">

    <p:ResourceStringDecorator 
        AssemblyName="PerspectiveDemo.Wpf"
        BaseName="View.Strings.RangeControls">
        <StackPanel VerticalAlignment="Center">
            <StackPanel.LayoutTransform>
                <ScaleTransform ScaleX="1.5" ScaleY="1.5" />
            </StackPanel.LayoutTransform>
            <StackPanel.Resources>
                <Style x:Key="RangeControlStyle" >
                    <Setter Property="RangeBase.Minimum" Value="0" />
                    <Setter Property="RangeBase.Maximum" Value="150" />
                </Style>
                <Style TargetType="{x:Type p:Knob}" BasedOn="{StaticResource RangeControlStyle}"/>
                <Style TargetType="{x:Type p:Fader}" BasedOn="{StaticResource RangeControlStyle}">
                    <Setter Property="Width" Value="200" />
                </Style>
            </StackPanel.Resources>
            <StackPanel >
                <TextBlock Margin="10" Text="Knob" HorizontalAlignment="Center"/>
                <StackPanel 
                    Orientation="Horizontal" 
                    HorizontalAlignment="Center" >
                    <StackPanel Margin="15">
                        <p:Knob x:Name="knob"/>
                        <TextBlock 
                            HorizontalAlignment="Center">
                            <TextBlock.Text>
                                <p:SignalBinding 
                                    ElementName="knob" Path="Value" 
                                    Converting="knobValueBinding_Converting"/>
                            </TextBlock.Text>
                        </TextBlock>
                    </StackPanel>
                    <StackPanel Margin="15">
                        <p:Knob x:Name="knob2"/>
                        <TextBlock 
                            HorizontalAlignment="Center">
                            <TextBlock.Text>
                                <p:SignalBinding 
                                    ElementName="knob2" Path="Value" 
                                    Converting="knobValueBinding_Converting"/>
                            </TextBlock.Text>
                        </TextBlock>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            <StackPanel 
                HorizontalAlignment="Center"
                Margin="30" >
                <TextBlock Margin="10" Text="Fader" HorizontalAlignment="Center"/>
                <p:Fader Margin="5"/>
                <p:Fader Margin="5"/>
            </StackPanel>
            <TextBlock 
                Margin="15"
                TextWrapping="Wrap" 
                HorizontalAlignment="Center"
                Text="{p:ResourceString RangeControlsDescription}"/>
        </StackPanel>
    </p:ResourceStringDecorator>
</Page>
